1. Field of the Present Invention
The present invention generally relates to the field of computer graphics and more particularly to a method and apparatus for improving the performance of texture mapping operations by decreasing the number of memory pages a texture mapping operation must access while rendering a typical graphic object such as a triangle or polygon.
2. History of Related Art
In the field of computer graphics, gross surface detail may be added to graphic objects by generating explicit surface detail objects that are coplanar with their associated graphic objects. For the replication of more detailed surface features, however, explicit generation of surface detail objects is typically not feasible. Instead, surface detail may be generated by storing a digital image, referred to as a texture image, and then mapping the texture image, or portions thereof, onto a graphic object. This technique is generally referred to as a texture mapping. Because the process of mapping the texture image to the graphic object is largely independent of the complexity of the texture image itself, texture mapping can significantly improve the performance of a graphics system that is required to generate graphics scenes with intricate surface detail. Unfortunately, however, the efficiency of a texture mapping operation, in which data is retrieved from a texture image memory, is frequently limited by the design of the texture image memory subsystem. More specifically, the texture image memory is typically arranged as a plurality or set of memory pages. Each page corresponds to a portion of the entire memory. When data is retrieved from (or written to) memory, the graphics memory subsystemxe2x80x9copensxe2x80x9d the page. Once a page is opened, memory locations within that page can be accessed in a relatively efficient manner. Opening the page, however, typically involves significant overhead in terms of the number of clock cycles required. Thus, a memory system is efficiently organized if the application that accesses the memory accesses a new memory page relatively infrequently. In the specific case of texture mapping applications, however, the arrangement of memory pages is typically not optimized to minimize the number of texture image memory pages that must be accessed when rendering an object. Accordingly, the texture mapping process for typically encountered graphics objects such as triangles and polygons is undesirably slow due to frequent opening of new memory pages. Therefore, it would be highly desirable to implement a strategy to address the number of memory pages accessed when applying texture images to graphics objects. It would be further desirable if the implemented solution did not significantly increase the cost or complexity of the memory subsystem and did not otherwise slow the performance of the graphics rendering process.
The problems identified above are in large part addressed by a method and an associated computer system for efficiently performing texture mapping operations. Efficiency is achieved by reducing the number of memory pages accessed during texture mapping of typical graphics objects such as triangles and polygons. Broadly speaking, the invention contemplates generating a texture image that comprises a set of texels. Each texel is assigned a (u,v) coordinate pair of a texture coordinate space. Each texel is then stored in memory at a memory address determined by applying a transformation function to the texel""s (u,v) coordinate pair. The transformation function is customized to associate two dimensional portions of the texture coordinate space to each page of memory. When the texture image (or a portion of the texture image) stored in memory is later mapped to an object during rendering the object, the allocation of two dimensional portions of the texture coordinate space to each memory page reduces the number of memory pages accessed during the rendering of the object. The reduction in the number of memory pages accessed during the texture mapping process translates into improved texture mapping performance. Preferably, the memory in which the texture image is stored comprises a dedicated texture memory of the graphics display system to eliminate contention with the frame buffer. In the presently preferred embodiment, the transformation function is accomplished by interleaving alternating u-bits and v-bits of the (u,v) coordinate pair to generate an offset value. The offset value is then added to a base address of the memory in which the texture image is stored to generate the memory address.